<template>
  <div>{{ renderedDate }}</div>
</template>
<script setup>
let props = defineProps(["time"]);
// console.log(props.time);
const date = new Date(props.time);

const month = date.getMonth() + 1;
const day = date.getDate().toString().padStart(2, "0");
const hours = date.getHours().toString().padStart(2, "0");
const minutes = date.getMinutes().toString().padStart(2, "0");

let renderedDate = "";

if (month === new Date().getMonth() + 1) {
  renderedDate = `${day}日 ${hours}:${minutes}`;
} else {
  renderedDate = `${month}月${day}日 ${hours}:${minutes}`;
}

// console.log(renderedDate);
</script>